#include "head.h"
void guess_num()
{
    int pow;
    int guess;
    int MAX = 100;
    int MIN = 1;
    srand(time(NULL));
    pow = rand()%100+1;
    while(1)
    {
        printf("猜一下\n");
        scanf("%d",&guess);
        if(guess>100 || guess<1)break;
        if(guess>=MAX || guess<=MIN)
        {
            printf("瞎搞,滚犊子\n");
            continue;
        }
        if(guess == pow)
        {
            printf("猜对咯！\n");
            break;
        }
        else if(guess > pow)
        {
            MAX = guess;
            printf("大了大了,在[%d,%d]之间\n",MIN,MAX);
        }
        else
        {
            MIN = guess;
            printf("小了小了,在[%d,%d]之间\n",MIN,MAX);
        }
    }

}